package com.wy.projectssj.controller;

import com.wy.projectssj.domain.PageBean;
import com.wy.projectssj.domain.SysLog;
import com.wy.projectssj.service.SysLogService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

/**
 * @Author: wy
 * @Date:2019/8/29 11:51
 */
 @Controller
 @RequestMapping("/sysLog")
public class SysLogController {
         @Autowired
          private SysLogService sysLogService;
     @RequestMapping("/findAll")
     public String findAll(@RequestParam(value="rows",defaultValue = "10") Integer rows,@RequestParam(value="currentPage",defaultValue = "1") Integer currentPage, Model model){
         PageBean<SysLog> pb = sysLogService.findAll(rows,currentPage);
         System.out.println(pb);
         model.addAttribute("pb",pb);
         return "syslog-list";
     }

     @RequestMapping("/save")
     public void save(SysLog sysLog){
         int save = sysLogService.save(sysLog);
     }
}
